#ifndef SP_DRIVER_KEYBOARD_H
#define SP_DRIVER_KEYBOARD_H

#include <system/regs.h>
#include <klibc/ctype.h>
#include <system/mod.h>

#define	SHIFT_LEFT	0x2A
#define	SHIFT_RIGHT	0x36
#define PAGE_UP		0x49
#define PAGE_DOWN	0x51
#define LOCK_CAPS	0x3A
#define LOCK_NUM	0x45
#define LED_NUM		2
#define LED_CAPS	4


extern module_t keyboard_module;

unsigned shift;
unsigned alt;
unsigned control;
unsigned capslock;
unsigned numlock;

char buf[256];
uint8_t bufsize;
uint8_t bufwhere;
uint8_t bufpoint;

char keyboard_getchar();
static void keyboard_callback(regs_t *);
uint32_t keyboard_init();
void keyboard_update_leds(uint8_t);
uint32_t keyboard_shut();
uint32_t keyboard_read(struct vfs_node_s *, char *, uint32_t, uint64_t);

#endif
